package ui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JTextArea;
import javax.swing.JTextField;

public class BaseBallEventHandler implements ActionListener {
	JTextArea jta_display = null;
	JTextField jtf_input = null;
	public BaseBallEventHandler
	(JTextField jtf_input, JTextArea jta_display)
	{
		this.jta_display = jta_display;
		this.jtf_input = jtf_input;
	}
	@Override
	public void actionPerformed(ActionEvent ae) {
		Object obj = ae.getSource();
		if(obj == jtf_input){
			jta_display.append(jtf_input.getText()+"\n");
			jtf_input.setText("");
		}
	}


}
